﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace 路由事件
{
    /// <summary>
    /// WindowMP.xaml 的交互逻辑
    /// </summary>
    public partial class WindowMP : Window
    {
        

        public WindowMP()
        {
            InitializeComponent();
        }

        public int eventCount = 0;
        private void SomethingClicked(object sender,RoutedEventArgs e)
        {
            eventCount++;
            string eventStr = "#" + eventCount.ToString() + ":\r\n"
                            + "sender:" + sender.ToString() + "\r\n"
                            + "Source:" + e.Source + "\r\n"
                            + "Original Source:" + e.OriginalSource + "\r\n"
                            + "Event:" + e.RoutedEvent;
            lstmsg.Items.Add(eventStr);
            e.Handled = (bool)checkBox.IsChecked;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            lstmsg.Items.Clear();
            eventCount = 0;
        }
    }
}
